Rework how 'eshell-ensure-newline-p' adds newlines
authorJim Porter <jporterbugs@gmail.com>
Thu, 23 May 2024 21:55:59 +0000 (14:55 -0700)
committerJim Porter <jporterbugs@gmail.com>
Wed, 29 May 2024 19:09:06 +0000 (12:09 -0700)
commiteac608cb8041222ba3b2eac48ac6f76ac36bab16
tree91343089d54746d0a6aae66e12c489c011078c67
parent9daf1085a9b11e056079edce8dccca92d69bf891
Rework how 'eshell-ensure-newline-p' adds newlines

This allows for other output targets (see the following commit) to be
"line-oriented".

* lisp/eshell/esh-io.el (eshell-ensure-newline-p): Move from esh-cmd.el.
(eshell-target-line-oriented-p, eshell--output-maybe-n)
(eshell-print-maybe-n, eshell-error-maybe-n)
(eshell-maybe-output-newline): New functions.

* lisp/eshell/esh-cmd.el (eshell-lisp-command): Don't print a newline
in this function directly; instead, use 'eshell-print-maybe-n' and
'eshell-error-maybe-n'.
(eshell-ensure-newline-p): Move to esh-io.el.

* lisp/eshell/em-unix.el (eshell/cat): Remove now-unnecessary override
of 'eshell-ensure-newline-p'.
lisp/eshell/em-unix.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-io.el